import {
  CHANGENAME,
  CHANGEINPUTTEL1,
  CHANGEDOORNUM,
  ADDRESS_200
} from "../../actionType";
const defaultState = {
  inputName: "",
  inputTel1: "",
  inputDoorNum: "",
  isAddress:false,
  address: [{ city: "", district: "", province: "" }],
  addressNow: "",
};
export default function (state = defaultState, action) {
  let newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case CHANGENAME:
      newState.inputName = action.params;
      break;
    case CHANGEINPUTTEL1:
      newState.inputTel1 = action.params;
      break;
    case CHANGEDOORNUM:
      newState.inputDoorNum = action.params;
      break;
      case ADDRESS_200:
        newState.isAddress = true;
        setTimeout(function(){
        newState.isAddress = false;
        },1000)
        break;
    default:
      break;
  }
  return newState;
}
